Output colored text in the shell using the echo commandNameecho-Displays a line of textProfileecho [Options] ... [String] ...DescribeOutputs a string to the standard output.-N does not output line breaks-E Open backslash ESC escape-e Suppress
Notes on using the echo command in Linux
1. Instructions for using the echo command: echo sends the input string to the standard output. The output strings are separated by blank characters, and the line number is added at the end. Function: display
Shell-5.shell echo CommandEcho---display contentFormat: Echo [options] Text-N Do not wrap in the last line-E parsing escape character\a issued a warning sound\c Finally, no newline symbol is added.\f Line break\ r Enter1.-N do not wrap in the last
First, the use of the echo commandDescription: Echo will send the input string to standard output. The output strings are separated by white space characters, and a newline number is added at the end.Function: Display charactersSyntax: Echo [-nee]
The echo display in the shell script is displayed in color with the echo displayed in color with the parameter-EThe format is as follows:
Copy Code code as follows:
Echo-e "\033[character background color; text color m string \033[0m"
echo Display in shell script with color display, echo display with color, need to use parameters-The e format is as follows: The copy code code is as follows: Echo-E"\033[Word background color; text color m string \033[0m"For example, copy the code
When Echo needs to change the color, use the-e parameter.Format: ECHO-e "\ 033 [background color; font color M string \ 033 [0 m"For example:Echo-e "\ 033 [41; 36 m something here \ 033 [0 m"
The position 41 represents the background color, and the
Using echo to display colored content in a shell script requires the use of the parameter-EThe format is as follows:" \033[Word background color; text color m string \033[0m"For example:" \033[41;36m Hello World \033[0m"Where 41 of the position
echo Display in shell script with color display, echo display with color, need to use parameter-EThe format is as follows:Echo-e "\033[word background color; text color m string \033[0m"Example: Echo-e "\033[41;36m something here \033[0m"Where 41 of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.